package zjitc.net.utils.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import javax.swing.*;
import java.sql.Connection;
import java.sql.SQLException;

public class C3P0Utils {
        public static DataSource dataSource =null;
        static {
                ComboPooledDataSource combo =new ComboPooledDataSource("mySource");

                dataSource =combo;

                }
        public  static Connection getConnection() throws SQLException {
                return  dataSource.getConnection();
        }


        public static DataSource getDateSource() {

                return dataSource;
        }
}
